package parser

import (
	"github.com/PuerkitoBio/goquery"
	"log"
)

var ch = make(chan struct{}, 5)

func GetDocFromUrl(url string) (*goquery.Document, error) {
	ch <- struct{}{}
	defer func() {
		<- ch
	}()

	log.Printf("Crawling url: %s\n", url)
	return goquery.NewDocument(url)
}